Translation API
Endpoint:/translate
https://api.botlhale.xyz/translate
MethodPOST
This endpoint handles language translation, primarily to English, but can support translations to other target languages if specified.
You need to include an
Authentication Token
in request headers. See the Authentication page of this documentation for information on how to generate authentication token codes.
Authentication
A valid Bearer token must be included in the request headers for authentication.
Headers:
- Authorization: Bearer
<your_token>
Form Arguments
This endpoint handles translations from the specified language to English, but can support translations to other target languages if specified.
Request Params | Data Type | Description | |
---|---|---|---|
Text | string | Required | This is the text to be translated. |
OrgID | string | Required | The unique identifier for the organization making the request. |
TargetCode | string | Optional | The target language code for translation. Defaults to 'en-ZA' (English - South Africa). |
TranslateID | string | Optional | A unique ID for the translation request, useful for fetching existing translations. |
LanguageCode | string | Optional | The source language code of the text. If not provided, the API will attempt to detect the source language automatically. |
Response
The API returns a JSON object with the following structure:
Unset
{
"Translation": "Translated text",
"DateReceived": "2025-01-28T10:00:00Z",
"Characters": 150,
"TranslateID": "abc123",
"detected_source_language": "fr"
}
Request Params | Data Type | Description |
---|---|---|
Translation | string | The translated text. |
DateReceived | string | The date and time when the request was received, in ISO 8601 format. |
Characters | integer | The number of characters in the source text. |
TranslateID | string | The unique ID of the translation request. |
detected_source_language | string | The detected source language of the text if language_code was not provided. |
Endpoint:/translate/v2
Method:POST
This endpoint handles language translation, primarily to English, but can support translations to other target languages if specified.
Authentication
A valid Bearer token must be included in the request headers for authentication.
Headers:
- Authorization: Bearer
<your_token>
Request Body | File Type | Description | |
---|---|---|---|
org_id | String | Required | The unique identifier for the organization making the request. |
text | String | Required | The text to be translated. |
language_code | String | Optional | The source language code of the text. If not provided, the API will attempt to detect the source language automatically. |
target_code | String | Optional | The target language code for translation. Defaults to 'en-ZA' (English - South Africa). |
translate_id | String | Optional | A unique ID for the translation request, useful for fetching existing translations. |
Response
Unset
{
"translation": "Translated text",
"date_received": "2025-01-28T10:00:00Z",
"characters": 150,
"translate_id": "abc123",
"detected_source_language": "fr"
}
Request Params | Data Type | Description |
---|---|---|
translation | string | The translated text. |
date_received | string | The date and time when the request was received, in ISO 8601 format. |
characters | integer | The number of characters in the source text. |
translate_id | string | The unique ID of the translation request. |
detected_source_language | string | The detected source language of the text if language_code was not provided. |
Supported Languages
The following table shows the languages Botlhale AI currently supports. The table also indicates the speech tasks supported for each language. Our team is always working to add new languages to the list.
Language | Region | Code | Translation | ASR | TTS | Diarization | Language ID |
---|---|---|---|---|---|---|---|
English | South Africa | en-ZA | √ | √ | √ | √ | √ |
isiZulu | South Africa | zu-ZA | √ | √ | √ | √ | √ |
isiXhosa | South Africa | xh-ZA | √ | √ | √ | √ | √ |
Sesotho | South Africa | st-ZA | √ | √ | - | √ | √ |
Setswana | South Africa | tn-ZA | √ | √ | √ | √ | √ |
Sepedi | South Africa | nso-ZA | √ | √ | √ | √ | √ |
Tshivenda | South Africa | vr-ZA | - | √ | √ | √ | √ |
Xitsonga | South Africa | ts-ZA | √ | √ | - | √ | √ |
Afrikaans | South Africa | af-ZA | √ | √ | √ | √ | √ |
Kiswahili | Kenya | sw-KE | √ | √ | √ | √ | - |
Kinyarwanda | Rwanda | rw-RW | √ | √ | - | - | - |
Contact us
We are here to help! Please contact us with any questions.